*imports data from csv file that is the output of cross_sectional_data

clear
*import delimited "add path to csv file here"
rename v1 time
rename v2 gse
rename v3 ltv_fraction_change
rename v4 m

gen bust =0
replace bust =1 if time==2
reg ltv_fraction_change c.gse##i.bust [aweight=m] 

gen date_factor = 200606 if time==0
replace date_factor = 200612 if time==1
replace date_factor = 200706 if time==2
replace date_factor = 200712 if time==3
replace date_factor = 200806 if time==4

xi: reg  ltv_fraction_change c.gse##i.date_factor [aweight=m]


coefplot, keep(200506.date_factor#c.gse 200512.date_factor#c.gse 200606.date_factor#c.gse 200612.date_factor#c.gse 200706.date_factor#c.gse 200712.date_factor#c.gse 200806.date_factor#c.gse 200812.date_factor#c.gse) yline(0)  vertical byopts(yrescale) levels(95 95) coeflabels(200506.date_factor#c.gse= "2005h1" 200512.date_factor#c.gse = "2005h2" 200606.date_factor#c.gse = "2006h1" 200612.date_factor#c.gse = "2006h2"  200706.date_factor#c.gse = "2007h1" 200712.date_factor#c.gse = "2007h2"   200806.date_factor#c.gse = "2008h1" 200812.date_factor#c.gse = "2008h2")


